package com.bl.student.dao.repository;

import com.bl.student.common.enums.InformationType;
import com.bl.student.dao.model.InformationEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

/**
 * Created by liangweikang on 18/1/20.
 */
public interface InformationRepository extends PagingAndSortingRepository<InformationEntity, String> {

    Page<InformationEntity> findByTypeOrderByWeightDesc(InformationType type, Pageable pageable);

    Page<InformationEntity> findAllByOrderByWeightDesc(Pageable pageable);

    Page<InformationEntity> findByTypeOrderByCreateTimeDesc(InformationType type, Pageable pageable);

    InformationEntity findById(String id);
}
